Skip to content

fix: include underscore SPA chunks in embed#13

Merged
ahaodev merged 1 commit into
mainfrom
ahaodev-fix-embed-all-dist
Jun 21, 2026
Merged

fix: include underscore SPA chunks in embed#13
ahaodev merged 1 commit into
mainfrom
ahaodev-fix-embed-all-dist

Conversation

@ahaodev

@ahaodev ahaodev commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • change go:embed pattern from dist/* to all:dist
  • ensure underscore-prefixed SPA chunks like _authenticated-*.js are embedded
  • prevent index.html fallback MIME mismatch causing 500 after login

Closes #12

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 21, 2026 06:26
@ahaodev ahaodev merged commit b720ae4 into main Jun 21, 2026
3 checks passed
@ahaodev ahaodev deleted the ahaodev-fix-embed-all-dist branch June 21, 2026 06:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes embedded (single-binary) deployments by ensuring Vite-generated SPA chunks whose filenames begin with _ (e.g. _authenticated-*.js) are included in the Go embed.FS, preventing the SPA fallback from incorrectly serving index.html (HTML MIME) for missing JS modules after login.

Changes:

  • Update //go:embed pattern from dist/* to all:dist so underscore-/dot-prefixed build artifacts are embedded.
  • Ensure authenticated-route code-split chunks are served as actual JS instead of falling back to index.html (avoids strict MIME module load failures / post-login 500).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 嵌入式部署认证路由 500:go:embed dist/* 漏掉下划线开头的 SPA chunk(应用 all:dist)

2 participants